fix: keep system tools with persona tool lists#8908
Conversation
There was a problem hiding this comment.
Code Review
This pull request removes the tool filtering logic based on persona allowed tools from the main agent building process. Specifically, the functions _ensure_persona_and_skills and _decorate_llm_request no longer return allowed tools, and the filtering of req.func_tool.tools in build_main_agent has been removed. This ensures that late-bound builtin tools (such as web search) and local runtime builtin tools (such as shell and Python execution) are preserved even when a persona specifies empty tools. Unit tests have been updated and added to verify this new behavior. As there are no review comments, no feedback is provided.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Summary
Tests
Summary by Sourcery
Preserve system-injected tools when personas specify explicit tool lists, and update tests accordingly.
Bug Fixes:
Enhancements:
Tests: